<div class="center_content">
	<div class="left_content">
		<ul class="nav nav-list">
			<li class="nav-header">
				Category
			</li>
			<% @categories.each do |category| %>
			<li>
				<%= link_to category.name, :controller => 'categories',:action => 'show',:id => category.id%>
			</li>
			<% end %>
		</ul>
	</div>
	<div class="right_content">
		<div class="search">
			<%= form_tag search_default_index_path, :method => :get do %>
			<%= select_tag :search_type, options_for_select(["Author", "Title", "ID Book"], @search_type), :class => "input-small search-filter" %>
			<%= text_field_tag :search_value, @search_value, :class => "search-input" %>
			<div class="search-btn">
				<%= submit_tag t("Search"), :class => 'btn'%>
			</div>
			<% end %>
		</div>
		<div class = "category">
			<div class = "category_title">
				<span><%= t("Search Result") %></span>
				<%= link_to t('Back'), :controller => 'default',:action => 'index' %>
			</div>
			<% if (@books != nil && @books.size != 0) %>
			<div class = "book_show">
				<ul>
					<% @books.each do |book| %>
					<li>
						<%= link_to (image_tag book.image_url),:controller => 'bookDetail',:action => 'show',:id => book.id%>
						<div class="data">
							<div class = "title">
								<%= link_to book.title,:controller => 'bookDetail',:action => 'show',:id => book.id%>
							</div>
							by
							<div class = "author">
								<%= book.author %>
							</div>
							<% if(book.description.length > 400)%>
							<p>
								<%= book.description[0,400].concat("...") %>
							</p>
							<% else %>
							<p>
								<%= book.description %>
							</p>
							<% end%>
							<%= link_to "Borrow",:controller => 'default',:action => 'index',:class => 'btn'%>
						</div>
					</li>
					<% end %>
				</ul>
			</div>
			<% else %>
			<div class = "book_show">
				There are no results
			</div>
			<% end %>
		</div>
	</div>
</div>
